#include <iostream>
using namespace std;

int main() {
   string str;
   cin>>str;
   int sum=0;
   char ans;
   sum=(str[0]-'0')*1+(str[2]-'0')*2+(str[3]-'0')*3+(str[4]-'0')*4+(str[6]-'0')*5+(str[7]-'0')*6+(str[8]-'0')*7+(str[9]-'0')*8+(str[10]-'0')*9;
   if(sum%11==10) ans='X';
   else ans=(sum%11)+'0';
   if(ans==str[12]){
    cout<<"Right"<<endl;
    return 0;
   }
   else 
   {
    str[12]=ans;
    cout<<str<<endl;
    return 0;
   }
}
